﻿using IcicleFramework.Entities;
using Microsoft.Xna.Framework;

namespace IcicleFramework.Components.Actions
{
    public class ImmediateAction : BaseAction
    {
        public override void Execute(IGameObject target, IActionData data = null, bool continuous = false)
        {
            Target = target;
            ActionData = data;
            ContinuousActions = continuous;
            PerformingActions = true;

            Execute();
        }

        public override IAction DeepClone()
        {
            return new ImmediateAction();
        }

        public override void Update(GameTime gameTime)
        {
            if (!ContinuousActions)
            {
                PerformingActions = false;
            }
        }
    }
}
